const fs = require('fs');

const Router = require('koa-router');

const router = new Router();

// 遍历当前文件夹，批量注册路由
fs.readdirSync(__dirname).forEach(fileName => {
    if (fileName != 'index.js') {
        let route = require('./' + fileName);
        router.use(route.routes());
    }
});

module.exports = router;